package GUIs;

//author dimi

import javax.persistence.EntityManager;

 
public class CProfile_ChecksGUI extends javax.swing.JFrame {
    
    private EntityManager em;
    
    // Ορίζω ως γονέα τη φόρμα CustomerGUI
    private CustomerGUI parent;
   
    public CProfile_ChecksGUI(CustomerGUI parent, EntityManager em) {
        this.em = em;
        this.parent = parent;
        initComponents();
        setLocationRelativeTo(null); // Κεντράρει το παράθυρο στην οθόνη
   
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        Panel_Checks_Welcome = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        Button_Checks_Exit = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        Panel_Checks_Welcome.setBackground(new java.awt.Color(0, 153, 153));
        Panel_Checks_Welcome.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(204, 255, 255));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("ΔΙΑΧΕΙΡΙΣΗ ΕΠΙΤΑΓΩΝ");

        javax.swing.GroupLayout Panel_Checks_WelcomeLayout = new javax.swing.GroupLayout(Panel_Checks_Welcome);
        Panel_Checks_Welcome.setLayout(Panel_Checks_WelcomeLayout);
        Panel_Checks_WelcomeLayout.setHorizontalGroup(
            Panel_Checks_WelcomeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Panel_Checks_WelcomeLayout.createSequentialGroup()
                .addGap(45, 45, 45)
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 318, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(33, Short.MAX_VALUE))
        );
        Panel_Checks_WelcomeLayout.setVerticalGroup(
            Panel_Checks_WelcomeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Panel_Checks_WelcomeLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE)
                .addContainerGap())
        );

        Button_Checks_Exit.setText("ΕΞΟΔΟΣ");
        Button_Checks_Exit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Button_Checks_ExitActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(Panel_Checks_Welcome, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(Button_Checks_Exit))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(Panel_Checks_Welcome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 216, Short.MAX_VALUE)
                .addComponent(Button_Checks_Exit))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void Button_Checks_ExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button_Checks_ExitActionPerformed
        System.out.println("Επιλογή Εξόδου από τη φόρμα Διαχείρισης Επιταγών");
        parent.setEnabled(true); // Ενεργοποιώ πάλι το παράθυρο της προηγούμενης φόρμας
        dispose();
    }//GEN-LAST:event_Button_Checks_ExitActionPerformed

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        System.out.println("Επιλογή Εξόδου από τη φόρμα Διαχείρισης Επιταγών");
        parent.setEnabled(true); // Ενεργοποιώ πάλι το παράθυρο της προηγούμενης φόρμας
        dispose();
    }//GEN-LAST:event_formWindowClosing

    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Button_Checks_Exit;
    private javax.swing.JPanel Panel_Checks_Welcome;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
}
